package cn.copera.dyy.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import cn.copera.dyy.common.persistence.IdEntity;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * 店面兑换记录
 * 
 * @author Administrator
 * 
 */
@Entity
@Table(name = "ka_exchange_record")
@DynamicInsert
@DynamicUpdate
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class ExchangeRecord extends IdEntity<ExchangeRecord> {
	private static final long serialVersionUID = 1L;
	private String nickName;// 昵称
	private String exchangePoint;// 兑换卡点
	private String exchangeContent;// 兑换内容
	private Shop shop;// 店铺
	private Date exchangeDate;//兑换时间
	private String exchangeDateStr;//兑换时间
	private String exchangeUser;//兑换人

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}
    
	public Date getExchangeDate() {
		return exchangeDate;
	}

	public void setExchangeDate(Date exchangeDate) {
		this.exchangeDate = exchangeDate;
	}

	public String getExchangePoint() {
		return exchangePoint;
	}

	public void setExchangePoint(String exchangePoint) {
		this.exchangePoint = exchangePoint;
	}

	public String getExchangeContent() {
		return exchangeContent;
	}

	public void setExchangeContent(String exchangeContent) {
		this.exchangeContent = exchangeContent;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "shop_id")
	@NotFound(action = NotFoundAction.IGNORE)
	@JsonIgnore
	public Shop getShop() {
		return shop;
	}

	public void setShop(Shop shop) {
		this.shop = shop;
	}

	public String getExchangeDateStr() {
		return exchangeDateStr;
	}

	public void setExchangeDateStr(String exchangeDateStr) {
		this.exchangeDateStr = exchangeDateStr;
	}

	public String getExchangeUser() {
		return exchangeUser;
	}

	public void setExchangeUser(String exchangeUser) {
		this.exchangeUser = exchangeUser;
	}
}
